using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Joy.Erp.BasicArchives.Core.Filters;

namespace Joy.Erp.BasicArchives.Asns
{
    [RemoteService(Name = BasicArchivesRemoteServiceConsts.RemoteServiceName)]
    [Area(BasicArchivesRemoteServiceConsts.ModuleName)]
    [ControllerName("AsnType")]
    [Route("api/basic-archives/asn-type")]
    public partial class AsnTypeController : BasicArchivesController, IAsnTypeAppService
    {
        protected IAsnTypeAppService AsnTypeAppService => LazyServiceProvider.LazyGetRequiredService<IAsnTypeAppService>();

        [HttpGet]
        [Route("{id}")]
        public Task<AsnTypeDto> GetAsync(Guid id)
        {
            return AsnTypeAppService.GetAsync(id);
        }

        [HttpGet]
        [Route("find")]
        public Task<AsnTypeDto> FindAsync(string filter)
        {
            return AsnTypeAppService.FindAsync(filter);
        }

        [HttpGet]
        [Route("find-by-source-key")]
        public Task<AsnTypeDto> FindBySourceKeyAsync(string sourceKey, string sourceType)
        {
            return AsnTypeAppService.FindBySourceKeyAsync(sourceKey, sourceType);
        }

        [HttpGet]
        public Task<PagedResultDto<AsnTypeDto>> GetListAsync(FilterRequestDto input)
        {
            return AsnTypeAppService.GetListAsync(input);
        }

        [HttpPost]
        [Route("query")]
        public Task<PagedResultDto<AsnTypeDto>> QueryAsync(FilterGroupRequestDto input)
        {
            return AsnTypeAppService.QueryAsync(input);
        }

        [HttpPost]
        public Task<AsnTypeDto> CreateAsync(AsnTypeCreateDto input)
        {
            return AsnTypeAppService.CreateAsync(input);
        }

        [HttpPut]
        [Route("{id}")]
        public Task<AsnTypeDto> UpdateAsync(Guid id, AsnTypeUpdateDto input)
        {
            return AsnTypeAppService.UpdateAsync(id, input);
        }

        [HttpDelete]
        [Route("{id}")]
        public Task DeleteAsync(Guid id)
        {
            return AsnTypeAppService.DeleteAsync(id);
        }
    }
} 